version: '3.8'

services:
  postgresql:
    image: postgres:14-alpine
    container_name: ps-psql
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    volumes:
      - ./data:/var/lib/postgresql/data
    networks:
      - ps

  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: go-app
    environment:
      - DB_DRIVER="postgres"
    ports:
      - "8080:8080"
    depends_on:
      - postgresql
    networks:
      - ps

networks:
  ps:
